# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 函数装饰器.py
Author: kij
Create Date: 2021/2/7
-------------------------------------------------
"""
import time


# def outter(func):
# 	def wrapper(*args, **kwargs):
# 		start = time.time()
# 		# 要装饰的方法的返回值
# 		res = func(*args, **kwargs)
# 		stop = time.time()
# 		print(stop - start)
# 		return res
# 	return wrapper
#
#
# @outter
# def index(x, y, z):
# 	time.sleep(3)
# 	print("index %s %s %s" % (x, y,z))
#
#
# # index = outer(index)
# index(1,2,3)

# # 有参装饰器
# from functools import wraps
#
# def setType(type):
# 	def outter(func):
# 		@wraps(func)
# 		def wrapper(*args,**kwargs):
# 			print(type)
# 			res = func(*args,**kwargs)
# 			print("wrapper")
# 			return res
# 		return wrapper
# 	return outter
#
# @setType(type="类型")
# def index():
# 	"""这个是备注"""
# 	print("index")
#
# print(index.__doc__)
#
# index()